#include "MyFLASH.h"
#include "stm32f10x.h"

uint32_t MyFLASH_ReadWord(uint32_t Address){
	//指针全字访问
	  return *((__IO uint32_t *)Address);
}

uint16_t MyFLASH_ReadHWord(uint32_t Address){
	//指针半字访问
	  return *((__IO uint16_t *)Address);
}

//全擦除
void MyFLASH_EraseALL(void){
	//解锁
	FLASH_Unlock();
	MyFLASH_EraseALL();
	FLASH_Lock();
}
void MyFLASH_ErasePage(uint32_t Address){
	FLASH_Unlock();
	FLASH_ErasePage(Address);
	FLASH_Lock();
}
void MyFLASH_ProgramWord(uint32_t Address,uint32_t data){
	FLASH_Unlock();
	FLASH_ProgramWord(Address,data);
	FLASH_Lock();
}
	
void MyFLASH_ProgramHWord(uint32_t Address,uint16_t data){
	FLASH_Unlock();
	FLASH_ProgramWord(Address,data);
	FLASH_Lock();
}